import json


for count in range(1,3):
    f = open( "D:/wt/pfile/newYorkList-" + str(count) + ".txt", "r" )
    print "No.",count,"file opened"
    string = f.read()
    f.close()

    wf = open( 'D:\wt\pfile\list.txt', 'a' )

    objs = json.loads( string )

    #print objs

    for obj in objs:
        wf.write( "%s.jpg %f %f \n" % ( obj['photo_id'], obj['latitude'], obj['longitude'] ) )

    wf.flush()
    wf.close()

